import request from '@/utils/request'
// 根据 id 改
export function setSysPermissionApi(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}
// 根据 id 查
export function getSysPermissionApi(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
// 根据 id 删
export function delSysPermissionApi(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}
// 增
export function addSysPermissionApi(data) {
  return request({
    url: `/sys/permission`,
    method: 'POST',
    data
  })
}
// 查询所有
export function getAllPermissionApi() {
  return request({
    url: `/sys/permission`
  })
}
// 给角色分配权限
export function setAssignPremApi(data) {
  return request({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}
